﻿<Window x:Class="GIMS.GUI.GeneralConfig.GeneralConfigWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="GeneralConfigWindow" Height="300" Width="300"
        SizeToContent="WidthAndHeight"
        ResizeMode="NoResize">
    <Window.Resources>
        <BooleanToVisibilityConverter x:Key="boolToVisibilityConverter" />
    </Window.Resources>

    <Grid x:Name="contentGrid" Background="LightGray">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*"/>
            <RowDefinition Height="5" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"></ColumnDefinition>
        </Grid.ColumnDefinitions>

        <!--Argument-Config-->
        <GroupBox Grid.Row="0" Margin="5,5,5,0" FontSize="12" FontWeight="Bold" 
                  Header="{Binding Path=ArgumentAsUiSetting.Name}" ToolTip="{Binding Path=ArgumentAsUiSetting.Description}"
                  Visibility="{Binding Path=HasArgument, Converter={StaticResource boolToVisibilityConverter}}">
            <ContentControl Margin="3" Content="{Binding Path=ArgumentAsUiSetting.ArgumentControlElement}" />
        </GroupBox>

        <!--Settings-Config-->
        <ItemsControl Grid.Row="1" ItemsSource="{Binding Path=SettingsAsUiElements}">
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <StackPanel Orientation="Vertical" />
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <GroupBox Margin="5,5,5,0" FontSize="12" FontWeight="Bold" Header="{Binding Path=Name}" ToolTip="{Binding Path=Description}">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Margin="3" Text="active:" />
                            <CheckBox HorizontalAlignment="Left" VerticalAlignment="Top" Margin="3" IsChecked="{Binding Path=IsActive, Mode=TwoWay}"/>
                            <ContentControl Margin="3" HorizontalAlignment="Right" IsEnabled="{Binding Path=IsActive}" Content="{Binding Path=ArgumentControlElement}"  />
                        </StackPanel>
                    </GroupBox>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
        
    </Grid>
</Window>
